package facade

import (
	"github.com/kataras/iris/v12"
	"github.com/kataras/iris/v12/mvc"
	"{{.Namespace}}/pkg/cmd-service/infrastructure/test"
    "{{.Namespace}}/pkg/cmd-service/domain/{{.aggregate_name}}/event"
)

var app *iris.Application

func init() {
    test.InitCommand(event.GetRegisterEventTypes())

	app = iris.New()
	mvc.Configure(app.Party("/api/v1.0"), func(app *mvc.Application) {
		app.Handle(New{{.Name}}CommandApi())
        {{- range $i, $entity := .Aggregate.Entities }}
        app.Handle(New{{$entity.Name}}CommandApi())
        {{- end }}
	})

}
